package com.example.test.bean.DTO;

import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
public class UserAddressDTO {
	/**
	 * 地址id
	 */
	private Integer id;

	@NotNull(message = "用户 ID 不能为空")
	private Integer userId;

	@NotBlank(message = "收货人姓名不能为空")
	private String name;

	@NotBlank(message = "手机号不能为空")
	@Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式错误")
	private String mobile;

	@NotNull(message = "省 ID 不能为空")
	private Integer provinceId;

	@NotNull(message = "市 ID 不能为空")
	private Integer cityId;

	@NotNull(message = "区 ID 不能为空")
	private Integer regionId;

	@NotBlank(message = "详细地址不能为空")
	private String detail;

	private Integer isDefault;
}
